package cn.mw.cmdb.enums;

import cn.hutool.json.JSONArray;
import com.alibaba.fastjson.JSONObject;

public enum HealthinessAlertEnum {
    SEVERE("严重", "severe"),
    URGENT("紧急", "urgent"),
    NORMAL("正常", "normal");

    private final String chineseName;
    private final String englishName;
    private static final String KEY = "healthinessAlert";

    HealthinessAlertEnum(String chineseName, String englishName) {
        this.chineseName = chineseName;
        this.englishName = englishName;
    }

    public String getChineseName() {
        return chineseName;
    }

    public String getEnglishName() {
        return englishName;
    }

    public static JSONObject getAll() {
        JSONObject object = new JSONObject();
        JSONArray jsonArray = new JSONArray();
        for (HealthinessAlertEnum value : HealthinessAlertEnum.values()) {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("chineseName", value.getChineseName());
            jsonObject.put("englishName", value.getEnglishName());
            jsonArray.add(jsonObject);
        }
        object.put(KEY, jsonArray);
        return object;
    }
}
